<template>
	<view class="subsDiaWrap font14">
        <view class="subTit font18 fontBold text-center">订阅楼盘</view>
        <view class="subBody">
            <view class="policyContent font13">
                订阅成功后，您将第一时间获取楼盘最新动态信息。授权您的手机号（为更好地为您提供个性化服务，我们可能会将您的手机号与该楼盘开发商共享，如您不希望使用该服务，您可选择取消订阅）
            </view>
            <view class="subBtns top-20 text-center">
                <view class="subAuthBtn col-fff bg-theme" @click="confirmAutnSubs">确认授权</view>
                <view class="top-15" @click="cancelAuthSubs">仅订阅，暂不授权</view>
            </view>
        </view>
    </view>
</template>

<script>
	import { mapState } from 'pinia';
	import { useUserInfoStore } from '@/store/index';
    import { checkLogin } from '@/common/common';
	export default {
        data() {
            return {
            }
        },
		props:{
            detail: {
                type: Object,
                default: () => ({})
            }
		},
		computed:{
			...mapState(useUserInfoStore, ['userInfo'])
		},
		methods:{
            //确认授权
            confirmAutnSubs() {
                if(!checkLogin()) {
                    uni.navigateTo({
                        url: `/pages/login/login?productId=${this.detail.id}`
                    })
                    return
                }
                this.$emit('comfirmAutn')
            },

            //取消授权
            cancelAuthSubs() {
                this.$emit('cancelAutn')
            }
		}
	}
</script>

<style scoped lang="scss">
.subsDiaWrap{
    .subTit{
        padding: 40rpx 0;
    }
    .subBody{
        padding: 40rpx 30rpx;
        .policyContent{
            line-height: 1.5;
        }
        .subBtns{
            .subAuthBtn{
                width: 50%;
                height: 70rpx;
                line-height: 70rpx;
                border-radius: 35rpx;
                margin: 0 auto;
            }
        }
    }
}
</style>
